package com.gjzhao.fmmall.controller;

import com.gjzhao.fmmall.beans.Users;
import com.gjzhao.fmmall.service.UserCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 查询用户信息 Controller
 * @Author: gjzhao
 * @Date Created in 2022-02-12 3:11 下午
 */
@RestController
public class UserCheckController {

    @Autowired
    private UserCheckService userCheckService;

    //查询用户
    @GetMapping("user/check")  //该服务不针对前端，同时该服务只提供一个服务，可讲mapping映射放在一起写，这样也更好写调用客户端
    public Users checkUser(@RequestParam("username") String username) {
        System.out.println("-----进入user-check服务-----");
        return userCheckService.checkUser(username);
    }

}
